package com.ygy.yfzx.license;

import de.schlichtherle.license.LicenseManager;
import de.schlichtherle.license.LicenseParam;


/**
 * LicenseManager的单例
 *
 * @author shengye
 * @date 2024/3/11 8:30
 */
public class LicenseManagerHolder {

    private static volatile LicenseManager LICENSE_MANAGER;


    public static  void  init(LicenseParam param){
        if (LICENSE_MANAGER == null) {
            synchronized (LicenseManagerHolder.class) {
                if (LICENSE_MANAGER == null) {
                    LICENSE_MANAGER = new CustomLicenseManager(param);
                }
            }
        }
    }
    public static LicenseManager getInstance() {
        if (LICENSE_MANAGER == null) {
            throw new RuntimeException("init fail");
        }
        return LICENSE_MANAGER;
    }

}
